package com.meituan.catering.management.product.biz.model.request;

import lombok.Data;
import javax.validation.Valid;
import java.math.BigDecimal;
import java.util.LinkedList;
import java.util.List;

/**
 * @author Believe
 * Date 2022/5/23 9:05
 */
@Data
public class CreateProductBizRequest {

    private String name;

    private BigDecimal unitPrice;

    private BigDecimal minSalesQuantity;

    private BigDecimal increaseSalesQuantity;

    private String unitOfMeasure;

    private String description;

    @Valid
    private List<MethodGroup> methodGroups = new LinkedList<>();

    @Valid
    private List<AccessoryGroup> accessoryGroups = new LinkedList<>();

    @Data
    public static class MethodGroup {

        private String name;

        private List<MethodGroup.Option> options = new LinkedList<>();

        @Data
        public static class Option {

            private String name;

        }
    }

    @Data
    public static class AccessoryGroup {

        private String name;

        private List<AccessoryGroup.Option> options = new LinkedList<>();

        @Data
        public static class Option {

            private String name;

            private BigDecimal unitPrice;

            private String unitOfMeasure;

        }
    }
}
